﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace PMS.Logic.BD
{
    public partial class IndexAjax : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            String methodName = Request.Form["method"];
            Type type = this.GetType();
            MethodInfo method = type.GetMethod(methodName);
            if (method == null) throw new Exception("method is null");
            try
            {

                method.Invoke(this, null);
            }
            catch
            {
                throw;
            }
        }
        /// <summary>
        /// 获得该用户权限树
        /// </summary>
        public void GetPerTree()
        {
            List<TreeNode> node = Permission.GetPerTree(OperateContext.SessPermission);
            //System.Runtime.Serialization.Json(node);

            string json = JsonConvert.SerializeObject(node);
            Response.Write(json);
        }

    }
}